home *** CD-ROM | disk | FTP | other *** search
/ Floppyshop 2 / Floppyshop - 2.zip / Floppyshop - 2.iso / diskmags / 0022-3.564 / dmg-0055 / 597.txt < prev    next >
Text File  |  1997-04-16  |  12KB  |  272 lines

  1. INFO-ATARI16 Digest         Thu,  2 Nov 89       Volume 89 : Issue 597
  2.  
  3. Today's Topics:
  4.                           Am I a DA? (long)
  5.          Congratulations (was: GEMDOS Extended Argument Spec)
  6.                         GNU C and sizeof(int)
  7.                          GNU C and SOZOBON C
  8.                          LHARC Source wanted!
  9.              Naive Question : ST & IBM Disk Compatibility
  10.                Ramblings of a madman (Sozobon C topics)
  11. ----------------------------------------------------------------------
  12.  
  13. Date: 1 Nov 89 19:51:32 GMT
  14. From: imagen!atari!kbad@ucbvax.Berkeley.EDU  (Ken Badertscher)
  15. Subject: Am I a DA? (long)
  16.  
  17. Several people have asked me recently how to write a program so that
  18. it could be used as both a desk accessory and as a program.  The problem
  19. is not too hard, but requires some mucking about with the startup code
  20. of the program - if you're not willing or able to do that, then you needn't
  21. read any further...
  22.  
  23. Still with me?
  24.  
  25. Okay, the key to identifying whether your code is running as a DA or a
  26. program is the parent basepage pointer in the basepage.  If the
  27. longword in the basepage at offset 36 (0x24) - which points to the
  28. basepage of whatever launched your code - is NULL (0), then your code
  29. is running as a DA.  The problem is that a DA does not get a pointer to
  30. its basepage on the stack like an application does.  In fact, a DA's
  31. registers (including the stack pointer!) contain garbage on startup,
  32. which is the reason that a DA must set up its own stack straight away.
  33.  
  34. The startup code provided with some compilers includes code which
  35. checks whether the parent basepage pointer is null or not.  This code
  36. usually gets around the aforementioned problem of locating the basepage
  37. by taking advantage of the way the system normally loads DAs and
  38. programs.  The TPA (Transient Program Area, i.e. text, data, BSS, and
  39. stack/heap) of a program or DA is normally contiguous with its basepage
  40. in memory.  All the startup code has to do is look back 256 bytes from
  41. the start of the text segment, which is the first part of the TPA, and
  42. voila!  There's the basepage.
  43.  
  44. The operative word here is "normally."  It is not entirely safe to
  45. assume that your program's basepage is contiguous with its TPA, because
  46. it is possible for a program to set up a non-contiguous basepage and TPA
  47. by using the more arcane Pexec() modes.  If you must assume that the
  48. basepage and TPA of your program are contiguous, then your startup code
  49. should validate that the basepage it is using points to a contiguous
  50. basepage and TPA.  If the basepage and TPA are contiguous, then the
  51. longword located 256 bytes before the text segment will point to
  52. itself, since the first longword of the basepage points to the base of
  53. the TPA.  Ideally, you should even go a step further, and check the
  54. text base address.  The third longword in that basepage should match
  55. your startup code's base address.
  56.  
  57. There is an alternative method which is not used by any startup code of
  58. which I am aware.  This method will allow the same code to run as a
  59. program or as a DA, and will also allow it to run with a non-contiguous
  60. basepage and TPA.  It also takes advantage of the way the system
  61. "normally" does things, but we can guarantee that the system will always
  62. do things this way.
  63.  
  64. I mentioned before that a DA's registers are garbage on startup, well,
  65. that's not entirely true.  When the DA gets control, register A0 always
  66. points to its basepage.  When a program is started by a GEMDOS Pexec(),
  67. register A0 is always cleared.  Using this fact, it is possible to
  68. implement startup code which gets the basepage address from register A0
  69. if the code is launched as a DA, or at 4(sp) if the code is launched by
  70. Pexec().  Since it knows how it was launched, it can also do the stack
  71. setup required of a DA, otherwise it can use the stack pointer it gets.
  72.  
  73. I strongly recommend that startup code implementors use the latter
  74. method of DA/program startup.  It allows far more flexibility in Pexec
  75. implementations, it works just as well as the "text base minus 256"
  76. method, and it is supported by Atari.
  77.  
  78.  
  79. --
  80.    |||   Ken Badertscher  (ames!atari!kbad)
  81.    |||   Atari R&D System Software Engine
  82.   / | \  #include <disclaimer>
  83.  
  84. ------------------------------
  85.  
  86. Date: 2 Nov 89 19:30:11 GMT
  87. From: ubc-cs!grads.cs.ubc.ca!buchanan@beaver.cs.washington.edu  (John Buchanan)
  88. Subject: Congratulations (was: GEMDOS Extended Argument Spec)
  89.  
  90. In article <1763@atari.UUCP> kbad@atari.UUCP (Ken Badertscher) writes:
  91. >
  92. >GEMDOS EXTENDED ARGUMENT (ARGV) SPECIFICATION
  93. >
  94. >Introduction
  95.  
  96.  
  97. This is what we have being waiting for.  Nice to hear an OFFICIAL
  98. word about this whole mess.
  99.  
  100.  
  101. WELL DONE ATARI.
  102.  
  103. ------------------------------
  104.  
  105. Date: 2 Nov 89 17:58:11 GMT
  106. From: watmath!rbutterworth@iuvax.cs.indiana.edu  (Ray Butterworth)
  107. Subject: GNU C and sizeof(int)
  108.  
  109. In article <1754@ruuinf.cs.ruu.nl> piet@cs.ruu.nl (Piet van Oostrum) writes:
  110. >Dlibs and Gemfast have been written for a 16 bit compiler.
  111. >I have a version of Dlibs that I adapted for use with GCC.
  112. >It has been modified for 32 bit integers.
  113.  
  114. This reminds me of something I've been wondering about for a while.
  115. Why does GCC on the ST have 32 bit ints?
  116. Surely 16 is the obvious size considering it has 16 bit memory access.
  117. (Note that I don't consider
  118.  "so that badly written code will still work ok"
  119.  as a valid reason.)
  120.  
  121. Every time anything accesses an int in CGG, it requires two memory
  122. accesses.  Most programs are full of things like "++i" or "i+=7"
  123. or "if(i>j)", and such things take approximately 100% longer when
  124. ints are 32 bits.
  125.  
  126. Even worse, take a look at the source for functions that interface
  127. with the OS.  Typically the function has a loop that takes the 32-bit
  128. ints from the stack and moves them to 16-bit words and then invokes
  129. the system trap with a pointer to this list.
  130. Surely it would be many times faster with 16-bit ints,
  131. since the function could simply pass a pointer to the stack arguments
  132. without having to do any of the moves and resizing.
  133.  
  134. Has anyone made a 16-bit GCC and library and done a comparison?
  135.  
  136. ------------------------------
  137.  
  138. Date: 31 Oct 89 17:09:53 GMT
  139. From:
  140.  gem.mps.ohio-state.edu!samsung!shadooby!mailrus!jarvis.csri.toronto.edu!utgpu!w
  141. atmath!ria!uwovax!7103_300@tut.cis.ohio-state.edu
  142. Subject: GNU C and SOZOBON C
  143.  
  144. In article <4830@sdcc6.ucsd.edu>, pa1329@sdcc13.ucsd.edu (pa1329) writes:
  145. > 1.  Can the GNU C complier use dlib and gemfast bindings for writing
  146. > TOS and GEM programs?
  147. >
  148.  
  149. The new GCC library (distributed with versions 1.34 and later) is partly
  150. based on dlibs, and partly on other PD routines. The intention was to
  151. provide the maximum degree of portability with UNIX and MS-DOS
  152. systems. I think it succeeds quite well; I've used the GCC to port dozens
  153. of applications (including NetHack 3.0) with remarkably little effort.
  154. There is a GEM library available for the GCC, which seems fairly complete;
  155. I can't recall if it was based on gemfast or not. There's also a port
  156. of Berkeley's curses package (you can't get much more portable than
  157. that :-). All this stuff is available by anonymous FTP from
  158. dsrgsun.ces.cwru.edu (129.22.16.2) and probably from other archive sites
  159. as well. (Of course, source code is available for everything.)
  160.  
  161. DISCLAIMER: I'm biased; I helped put together the library, and wrote some
  162. of the routines. What I didn't like, I fixed...
  163.  
  164. Eric Smith
  165. ersmith@uwovax.uwo.ca
  166.  
  167. ------------------------------
  168.  
  169. Date: 2 Nov 89 03:08:57 GMT
  170. From: rochester!rit!ultb!ajy2208@pt.cs.cmu.edu  (A.J. Yarusso)
  171. Subject: LHARC Source wanted!
  172.  
  173. Help!
  174. =====
  175.  
  176.   I am looking for the sources to LHARC, if they are in the public
  177. domain...  LHARC is very slow and a bunch of us here in Rochester would
  178. love to re-write.   Rest assured that this will be the first place an
  179. improved version of LHARC would appear, so any help I receive in getting
  180. the source will benefit you too (in the long run)....
  181.  
  182.   Thanks,
  183.  
  184.   (keeping my fingers crossed that LHARC is public domain)..
  185.  
  186. _____________________________________________________________________________
  187.  Albert Yarusso, Rochester     ajy2208@ritvax.bitnet, ajy2208@ultb.rit.edu
  188.  Institute of Tech. _________________________________________________________
  189.  Computer Science  /___   /    ?rutgers, ames?!rochester!ritcv!ajy2208
  190. ______________________/  /     ajy2208@ritcv.cs.rit.edu     GEnie:  A.Yarusso
  191.  
  192. ------------------------------
  193.  
  194. Date: 2 Nov 89 17:08:24 GMT
  195. From: e2big.dec.com!ynotme!wallace@decuac.dec.com  (Ray Wallace)
  196. Subject: Naive Question : ST & IBM Disk Compatibility
  197.  
  198. In article <1989Nov1.232645.9023@agate.berkeley.edu>,
  199.  ladasky@codon3.berkeley.edu (John Ladasky;1021 Solano No. 2;528-8666) writes...
  200. >but when I went to the PC on campus that is hooked in to the network, it
  201. >wouldn't read it!
  202.  
  203. DCFROMAT will also make a ST floppy useable on a PC. Don't use folders on the
  204. disk as this causes problems sometimes. If formatting on the ST doesn't work
  205. try formatting it on the PC (format for DD not HD, ie: 726kb not 1.44mb or
  206. whatever the exact # is) and then put it in the ST to copy the files onto.
  207.  
  208. I've had luck using DCFORMAT on the ST, writting the files on a Tandy PC, then
  209. reading the files on the ST. Some combinations work for some people other
  210. combinations for other people (or machines). The best you can do is try a few
  211. different things and hope one way eventualy works for you.
  212.  
  213. Good luck,
  214.  
  215. ---
  216. Ray Wallace
  217.                 (INTERNET,UUCP) wallace@oldtmr.enet.dec.com
  218.                 (UUCP)          ...!decwrl!oldtmr.enet!wallace
  219.                 (INTERNET)      wallace%oldtmr.enet@decwrl.dec.com
  220. ---
  221.  
  222. ------------------------------
  223.  
  224. Date: 2 Nov 89 08:02:10 GMT
  225. From: thelake!steve@UMN-CS.CS.UMN.EDU  (Steve Yelvington)
  226. Subject: Ramblings of a madman (Sozobon C topics)
  227.  
  228. In article <8911011638.AA18226@ucbvax.Berkeley.EDU>,
  229.      S61304@PRIME-A.POLY-SOUTH-WEST.AC.UK (Rat) writes ...
  230.  
  231. >Having just read a message in Vol. 89 Issue 565 questioning whether there is a
  232. >shell available for Sozobon C, I would also like to second this question!
  233. >
  234. >I am starting my final year project using Sozobon C and would find a shell
  235. >_VERY_ useful, espesially if it can handle environment variables.
  236.  
  237. Sozobon C works perfectly well with Un*x-style shells, such as Gulam, tsh,
  238. etc. I use jShell, which perhaps John Stanley will someday quit making
  239. perfect and post. :-)
  240.  
  241. But I suppose you're looking for a GEM shell for Sozobon C.
  242.  
  243. I worked on one for a month or two. A number of factors stopped me:
  244.  
  245.         * I'm not good enough at programming to make a "gee-whiz"
  246.         graphic compiler shell -- something like Think C on the Macintosh.
  247.         This is a hobby. I don't do this for a living.
  248.  
  249.         * I got involved in other projects, namely some Usenet netnews
  250.         software.
  251.  
  252.         * I didn't find it useful.
  253.  
  254. The last point is probably the most important. I really didn't see much
  255. use for GEM in the write-compile-link-test cycle. Working from a command
  256. line is a lot more convenient. I'd rather type "cc fubar.c" than
  257. point-click-point-click-point-click-point-click-knock-over-my-coffee-cup.
  258.  
  259. If you disagree, I'd like to hear why. What do you expect to get out of a
  260. compiler shell? What sort of user interface do you envision? I might be
  261. persuaded to dredge up my SeeShell code and start hacking at it again.
  262.  
  263. Or maybe you'll be inspired to write your own.
  264.  
  265.    -- Steve Yelvington, up at the lake in Minnesota
  266.   ... pwcs.StPaul.GOV!stag!thelake!steve             (UUCP)
  267.  
  268. ------------------------------
  269.  
  270. End of INFO-ATARI16 Digest V89 Issue #597
  271. *****************************************
  272. =========================================================================